{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "Putting it All Together: UCI Breast Cancer Data Set"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "'''The dataset is provided thanks to:\n",
    "\n",
    "Street, N.  (1990). UCI Machine Learning Repository [https://archive.ics.uci.edu/ml/machine-learning-databases/breast-cancer-wisconsin/breast-cancer-wisconsin.data]. Madison, WI: University of Wisconsin, Computer Sciences Dept.\n",
    "'''"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "radius             int64\n",
       "texture            int64\n",
       "perimeter          int64\n",
       "area               int64\n",
       "smoothness         int64\n",
       "compactness       object\n",
       "concavity          int64\n",
       "concave points     int64\n",
       "symmetry           int64\n",
       "malignant          int64\n",
       "dtype: object"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "data_web_address = data_web_address = \"https://archive.ics.uci.edu/ml/machine-learning-databases/breast-cancer-wisconsin/breast-cancer-wisconsin.data\"\n",
    "column_names = ['radius',\n",
    "                'texture',\n",
    "                'perimeter',\n",
    "                'area',\n",
    "                'smoothness' \n",
    "                ,'compactness',\n",
    "                'concavity',\n",
    "                'concave points', \n",
    "                'symmetry',\n",
    "                'malignant']\n",
    "\n",
    "feature_names = column_names[:-1]\n",
    "all_data = pd.read_csv(data_web_address , names=column_names)\n",
    "all_data.dtypes"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    458\n",
       "1    241\n",
       "Name: malignant, dtype: int64"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#changing the state of having cancer to 1, not having cancer to 0\n",
    "all_data['malignant'] = all_data['malignant'].astype(np.int)\n",
    "all_data['malignant'] = np.where(all_data['malignant'] == 4, 1,0) #4, and now 1 means malignant\n",
    "all_data['malignant'].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "X = all_data[[col for col in feature_names if col != 'compactness']]\n",
    "y = all_data.malignant\n",
    "\n",
    "from sklearn.model_selection import train_test_split\n",
    "X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=7,stratify=y)\n",
    "\n",
    "from sklearn.linear_model import LogisticRegression\n",
    "\n",
    "lr = LogisticRegression()\n",
    "lr.fit(X_train,y_train)\n",
    "y_pred_proba = lr.predict_proba(X_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.legend.Legend at 0xd1868d0>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAEUCAYAAADXzmpaAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHqpJREFUeJzt3Xt0VfWd9/HPNwGfCoRLgmgEAiooyICOFmoraLw8go5T\nq3aKiqA8M0+pUOws2xl7m5pxxrHOrC6Vx9EpDjrShYspdUaxasFVDdYroIIWQaQKAnG4C+USCMnn\n+SOHQy4nsBPDOUl8v9baa2Xv/dv7fM8Pcj7Z+7f3PmFbAAAkkZfrAgAA7QehAQBIjNAAACRGaAAA\nEiM0AACJERoAgMSyHhoRMSsiNkXEO0doMyMiPoiIZRFxdjbrAwA0LRdHGo9KGtvUyoi4XNJptgdL\nmiLp37JVGADgyLIeGrZflrTjCE2ukjQ71fYNST0i4sRs1AYAOLK2OKbRV9L6OvMbU8sAADnWFkMD\nANBG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q3333Xd70KBBrq6urrePOXPm+IILLnBeXl69dStWrPC+ffts2++//75P\nOukkv/XWW7btTz/91B9++KFtu6amxjNmzPCIESPS295zzz0+++yzvWXLFu/fv9+TJk3ytddem/E9\nfPTRR+7UqZM//vjj9LIxY8b4e9/7nv/4xz/64MGDXrZsWXrdLbfc4rFjx3r37t3etWuXL730Un/3\nu99Nr3/wwQf9wgsveOTIkX7sscfqvdb777/vRx55xPPnz3deXl6jWhYuXOiBAwd68eLFtu2KigpX\nVFRkrLup36nU8pZ97rZ0w7YwERodS3sIjTvvvNOjR4/2d7/7XV955ZX11h0tNFavXu38/HwvXbo0\n0Wtt3brVeXl53rlzZ5NtnnzySZ999tnu3r27Bw0a5AULFtiu/SD56le/6sLCQg8ePNgPP/xwepuy\nsjJ//etf94033ugePXp41qxZrqmp8d133+3TTjvNvXv39vjx471jx46Mr7lw4UL369ev3rKSkpL0\na9e1e/duR4S3bt2aXvbNb37TkyZNsm0/8MAD/rM/+7P0upqaGh9//PF+4YUX0st27tzpM844w2+8\n8Uaj0Khr1apVLi4u9rx58xqtq6qq8gMPPOCuXbuml91yyy2+/fbb0/PPPPOMhwwZknHfZWVlvvji\ni+v1wSmnnOKampqM7S+//HI/9NBD6fl//dd/9bhx4xq1Gz16dKPQOGTNmjUZQ+MrX/mKH3nkkYzb\nNHQsQoPTU0AzzJ49WzfeeKNuuOEGLViwQFu2bEm87W9/+1v1799f5557bqL2RUVFGjRokCZMmKCn\nnnpKmzdvrrd+8eLFuummm/Szn/1MO3fu1EsvvaSBAwdKksaPH6+SkhL9z//8j+bNm6cf/vCHKi8v\nT287f/58feMb39Cnn36qCRMmaMaMGZo/f75+97vfqaKiQr169dLUqVPT7c866yzNnTtXUu3pkxEj\nRtSr5ayzzsp4is12o8FY2/r973+f8T3X1NQ0Wv/DH/5QU6dO1YknZv4Cz2nTpqlr164aOnSoTj75\nZF1xxRX11vfq1UtdunTRd77zHf3oRz9KL//Lv/xLvfzyy/rkk0+0d+9ezZkzp9G2h/ziF7/QzTff\nnJ5//fXXdfrpp2vSpEnq3bu3vvSlL+mll16qV9PTTz+tTz/9VDt27NATTzzR5L6bo6amRkuXLtXm\nzZs1ePBglZSUaPr06dq/f/9n3ndiLU2btjCJI40OpeG/Z+Y2n31qqd/97nc+7rjjvH37dtv20KFD\nfd9996XXH+1I46677vKXv/zlZr3mxo0b06e08vPzfcEFF3jNmjW27SlTpvi2225rtM369evdqVMn\n79mzJ73sBz/4gSdPnmy79q/mCy+8sN42Q4cOrffXfUVFhTt37pzxr/p/+Id/8PXXX19v2YQJE/z3\nf//3Gd/DmDFjfOutt7qystJvvvmmCwsL03/Rr1q1yt26dfOiRYt84MAB33nnnc7Pz/dPf/pT2/aS\nJUv8p3/6p66pqfHatWubPNKoqanxK6+84rvuuivj6ba9e/f6oYce8jPPPJNetnPnTl933XWOCHfu\n3NnnnHNOxqOrl156yQUFBfX685vf/Kbz8vL86KOP+uDBg547d6579uzpbdu2pfvv0ksvdV5envPz\n833ZZZdlPH3X3CONiooKR4RHjhzpTZs2edu2bT7//PP94x//OOM+mvqdEkca+LxojdhoqdmzZ+uy\nyy5Tr9RNQNdff70ee+yx9PpOnTo1GhyvqqpS586dJdUeORwaaE3q5JNP1owZM/TBBx9o3bp16tq1\nqyZNmiSpdrD2tNNOa7RNRUWFCgsL1aVLl/SyAQMGaOPGw99l1nBwft26dbr66qtVWFiowsJCnXnm\nmercubM2bWr8VTbdunXTrl276i3buXOnCgoKMr6HOXPm6MMPP1RJSYmmTZumiRMnql+/fpKkM844\nQ4899pimTZumk08+Wdu3b9fQoUPVr18/2da0adN0//33H/Vy7IjQV77yFa1fv14PPfRQo/XHH3+8\npkyZokmTJmnr1q2SpKlTp2r//v3asWOH9uzZo6uvvlrjxo1rtO3s2bN17bXX1uvP448/XgMHDtTN\nN9+s/Px8jR8/Xv37908PSP/FX/yFzjjjDO3Zs0e7du3SqaeeqgkTJjRZf1LHH3+8JOnWW29Vnz59\nVFhYqNtuu03PPvvsZ953UoQGkEBlZaV++ctfatGiRSouLlZxcbHuu+8+LV++XO+++64kqaSkpNFz\nfj788EMNGDBAUu3VPxs2bNBbb73Vohr69u2radOmpU/d9O/fX3/4wx8atTv04btnz570so8//lh9\n+/ZNz0fUv0S/pKREzz33nLZv367t27enP0iLi4sb7X/YsGF655136i175513NGzYsIx19+/fX08/\n/bQ2bdqk1157TVu2bNGoUaPS66+55hq9++672rJli8rKyrR27VqNGjVKu3bt0tKlSzV+/HgVFxdr\n1KhRsq1+/fo1ebXQwYMHM/aJJFVXV2vv3r3p8Fy+fLkmT56sHj16qHPnzpo+fboWL16s7du3p7ep\nrKzUvHnz6p2akqQRI0Y06sO688uXL9eUKVP0hS98QV26dNG3vvUtPffccxnrao6ePXumAzfT62ZF\nSw9R2sIkTk91KA3/PduSxx9/3EVFRd6wYYM3bdqUni688EJ/73vfs20vWLDAJ554Yvqqlvfff99D\nhw71zJkz0/u59dZbffrpp6evnqqsrPTcuXMzXj21Y8cO33HHHV6zZo1ramq8ZcsWX3PNNR47dqxt\ne/Hixe7Vq5dfeOEF19TUeOPGjV61apVt+4ILLvD06dNdWVnp5cuX+8QTT0yffiorK/PEiRPrvda9\n997r0tJSr1u3zra9efNmP/XUUxn74sCBAx44cKBnzJjh/fv3+/777/fAgQObvHpq5cqV/uMf/+gD\nBw74F7/4hU844YR6A+Nvvvmmq6urvXnzZn/jG9/wjTfemF5Xt6+XLFniiPAnn3ziqqoqb9682XPn\nzvXu3btdXV3t3/zmN+7WrZt//etf27aff/55v/32266urvbOnTs9ffp09+3b1/v377dtT5482V//\n+te9c+dOHzhwwHfddVejAf45c+b4lFNOafSetm/f7sLCQs+ePdvV1dWeN2+ei4qK0qenLr74Yt96\n663et2+f9+7d61tuucXnn39+vT7ct2+fzz//fD/88MOurKysN6heWVnpFStWOCJcWVmZrtm2f/KT\nn3jUqFHevHmzt2/f7jFjxviOO+7I2PdN/U6Jq6cOdUTG/kE70ZZDY9y4cf6bv/mbRst/+ctfuri4\nOH2e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viyp\ne2r+31X7/QxXS3pGtc//uqLB9gMl3SPpn1T7zWmc1kK7wukpoBlsfxQRh54evNT23oi4MDX/rO0f\np35+PiIGSfqxpGfr7KJQ0sW2381SyUCr4kgDaD1PNpj/L0nnpp42fMhGAgPtGaEBtA6r8feQb1bt\n0XzvOss64ve84HOE0ABaR0jq02BZH0kHJW2ts4xr3NGuERpA67m6wfw1kt40N0OhA2EgHGg9l0fE\nP0paJOlaSZdI+mpuSwJaF0caQOuwpL+SdI6k/5Z0hWq/k/yZnFYFtDIeIwJ8RqlLbl+QNLwjfu82\nUBdHGkDriKM3Ado/QgNoHRyy43OB01MAgMQ40gAAJEZoAAASIzQAAIkRGgCAxAgNAEBihAYAILH/\nD2v6CFgwx9oQAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xd1939e8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "%matplotlib inline\n",
    "from sklearn.metrics import roc_curve, auc, roc_auc_score\n",
    "\n",
    "fpr, tpr, ths = roc_curve(y_test, y_pred_proba[:,1])\n",
    "\n",
    "auc_score = auc(fpr,tpr)\n",
    "plt.plot(fpr,tpr,label=\"AUC Score:\" + str(auc_score))\n",
    "plt.xlabel('fpr',fontsize='15')\n",
    "plt.ylabel('tpr',fontsize='15')\n",
    "plt.legend(loc='best')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
